package pojo.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

public class PageBean {
    private Integer  pageNum;
    private Integer pageSize;
    private String findWhere;
    private Integer offset;

    public void offset(){
        offset = (pageNum-1) *pageSize;
    }

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public String getFindWhere() {
        return findWhere;
    }

    public void setFindWhere(String findWhere) {
        this.findWhere = findWhere;
    }

    public Integer getOffset() {
        return offset;
    }

    public void setOffset(Integer offset) {
        this.offset = offset;
    }

    public PageBean() {
    }

    public PageBean(Integer pageNum, Integer pageSize, String findWhere, Integer offset) {
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.findWhere = findWhere;
        this.offset = offset;
    }

    @Override
    public String toString() {
        return "PageBean{" +
                "pageNum=" + pageNum +
                ", pageSize=" + pageSize +
                ", findWhere='" + findWhere + '\'' +
                ", offset=" + offset +
                '}';
    }
}
